var e = require;
var t = module;
var o = exports;
var ii, nn = this && this.__extends || (ii = function (t, e) {
    return (ii = Object.setPrototypeOf || {
        __proto__: []
    }
        instanceof Array &&
        function (t, e) {
            t.__proto__ = e
        } ||
        function (t, e) {
            for (var o in e) Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o])
        })(t, e)
},
    function (t, e) {
        function o() {
            this.constructor = t
        }
        ii(t, e),
            t.prototype = null === e ? Object.create(e) : (o.prototype = e.prototype, new o)
    }
),
    rr = this && this.__awaiter ||
        function (t, e, o, i) {
            return new (o || (o = Promise))(function (n, a) {
                function r(t) {
                    try {
                        l(i.next(t))
                    } catch (e) {
                        a(e)
                    }
                }
                function s(t) {
                    try {
                        l(i.
                            throw(t))
                    } catch (e) {
                        a(e)
                    }
                }
                function l(t) {
                    var e;
                    t.done ? n(t.value) : (e = t.value, e instanceof o ? e : new o(function (t) {
                        t(e)
                    })).then(r, s)
                }
                l((i = i.apply(t, e || [])).next())
            })
        };
var oo = (this && this.__decorate) ||
    function (e, t, a, n) {
        var i,
            o = arguments.length,
            s = o < 3 ? t : null === n ? (n = Object.getOwnPropertyDescriptor(t, a)) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) s = Reflect.decorate(e, t, a, n);
        else
            for (var r = e.length - 1; r >= 0; r--)
                (i = e[r]) && (s = (o < 3 ? i(s) : o > 3 ? i(t, a, s) : i(t, a)) || s);
        return o > 3 && s && Object.defineProperty(t, a, s), s;
    }; Object.defineProperty(o, "__esModule", { value: !0 });
var a = e("BaseModuleUI"),
    n = e("GlobalParams"),
    i = e("Game"),
    r = cc._decorator,
    s = r.ccclass,
    l = r.property,
    _ = (function (e) {
        function t() {
            var t = (null !== e && e.apply(this, arguments)) || this;
            return (
                (t.skin_node = null),
                (t.now_node = null),
                (t.over_node = null),
                (t.days_num = null),
                (t.signin_node = null),
                (t.coin_num_label = null),
                (t.award_node = null),
                (t.award_type = null),
                (t.signin_index = 0),
                (t.signin_info = null),
                (t.signin_type_string = ["金币补给", "钻石补给", "绝版英雄"]),
                t
            );
        }
        return (
            nn(t, e),
            (t.prototype.showSigninInfo = function (e) {
                (this.signin_index = e), (this.signin_info = i.default.signin_info[this.signin_index]);
                var t = n.GlobalParams.PlayerSigninInfo.value,
                    o = t.signin_num;
                t.signin_date == new Date().toLocaleDateString() && (o -= 1),
                    o > 6 && 6 == this.signin_index && (this.signin_info = i.default.signin_info[7]),
                    (this.days_num.string = "" + this.signin_info.days),
                    (this.coin_num_label.string = "x" + this.signin_info.num),
                    (this.skin_node.active = o < 7 && 7 == this.signin_info.days),
                    (this.now_node.active =
                        o % 7 == this.signin_info.days - 1 && t.signin_date != new Date().toLocaleDateString()),
                    (this.over_node.active =
                        this.signin_info.days <= o % 7 ||
                        (t.signin_date == new Date().toLocaleDateString() && o % 7 == this.signin_info.days - 1)),
                    (this.signin_node.active = this.over_node.active),
                    (this.award_node.children[0].active =
                        !this.skin_node.active && !this.over_node.active && 0 == this.signin_info.type),
                    (this.award_node.children[1].active = this.skin_node.active),
                    (this.award_node.children[2].active = this.over_node.active && 0 == this.signin_info.type),
                    (this.award_node.children[3].active =
                        !this.skin_node.active && !this.over_node.active && 1 == this.signin_info.type),
                    (this.award_node.children[4].active = this.over_node.active && 1 == this.signin_info.type),
                    (this.award_type.string = "" + this.signin_type_string[this.signin_info.type]),
                    this.now_node.active
                        ? (this.award_type.node.color = new cc.Color(230, 179, 28))
                        : this.skin_node.active
                            ? (this.award_type.node.color = new cc.Color(140, 68, 195))
                            : this.over_node.active
                                ? (this.award_type.node.color = new cc.Color(150, 150, 150))
                                : (this.award_type.node.color = new cc.Color(14, 143, 210)),
                    (this.node.getComponent(cc.Button).interactable = this.now_node.active);
            }),
            oo([l(cc.Node)], t.prototype, "skin_node", void 0),
            oo([l(cc.Node)], t.prototype, "now_node", void 0),
            oo([l(cc.Node)], t.prototype, "over_node", void 0),
            oo([l(cc.Label)], t.prototype, "days_num", void 0),
            oo([l(cc.Node)], t.prototype, "signin_node", void 0),
            oo([l(cc.Label)], t.prototype, "coin_num_label", void 0),
            oo([l(cc.Node)], t.prototype, "award_node", void 0),
            oo([l(cc.Label)], t.prototype, "award_type", void 0),
            oo([s], t)
        );
    })(a.default);
o.default = _;
